1. Technical Field
The present invention relates to a method for controlling data-write operation of amass storage device, and more particularly, to a method for controlling data-write operation of a mass storage device according to sensed input voltage of a memory unit.
2. Description of the Conventional Art
As related technology keeps improving, various types of mass storage devices such as hard drives or flash drives are developed for storing data according to requirements. Please refer to FIG. 1. FIG. 1 is a diagram showing a mass storage device 100 of the conventional art. As shown in FIG. 1, the mass storage device 100 of the conventional art comprises a memory unit 110 (such as a flash memory unit), and a controller 120. The memory unit 110 is utilized for storing data, and the memory unit 110 is powered by an input voltage Vi(generally 3.3 volt) provided from a host device 200. The controller 120 is utilized for controlling data access of the memory unit 110, for example, the controller 120 can perform operations of writing data into the memory unit 110, reading data stored in the memory unit 110, and etc.
Generally, a flash memory unit works normally when working voltage of the flash memory unit is between 3.3 volt and 3.5 volt. When the working voltage of the flash memory unit is between 2.7 volt and 3.3 volt, the flash memory still can work, but may cause some data loss. When the working voltage of the flash memory unit is lower than 2.7 volt, the flash memory unit can not work normally, so as to significantly increase possibility of data loss.
Please refer to FIG. 2, and refer to FIG. 1 as well. FIG. 2 is a diagram illustrating data write operation of the mass storage device 100 of FIG. 1. When the controller 120 performs data write operation, the controller 120 writes data into the memory unit 110 at a predetermined data write frequency, and the predetermined data write frequency is a fixed frequency. During the data write operation, when the host device 200 provides an unstable voltage to the mass storage device 100, and causes the input voltage Vi of the memory unit 110 to drop to a voltage level lower than 2.7 volt, the memory unit 110 may not work normally to write data due to insufficient voltage level, such that the data written into the memory unit 110 between time T1 and time T2 may be lost. The mass storage device 100 of the conventional art does not have any protection mechanism to prevent the above situation of data loss when the input voltage Vi of the memory unit 110 is unstable.